package com.hi5.stexviewer.rates;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.hi5.stexviewer.domain.Market;
import com.hi5.stexviewer.domain.Rate;
import com.hi5.stexviewer.domain.Stock;

/**
 * Fetch listings from various sources.
 *
 * @author mate
 *
 */
public interface RateFetcher {
    /**
     * Gets rates for a given time interval. (Or do its best to do so.)
     *
     * @param stocks stocks to query
     * @param start from that time until now
     * @return list of rates mapped to stocks in which nothing can be {@code null}, or {@code null} when a huge error occurs.
     */
    Map<Stock, List<Rate>> getRates(List<Stock> stocks, Date start);

    /**
     * Decides whether to given Market is supported or not.
     *
     * @param market the stock exchange to validate
     * @return {@code true} if supported, otherwise {@code false}
     */
    boolean supports(Market market);
}
